package userSrv

import (
	"context"
	"serviceApi/formData/userApi"
	"serviceApi/global"
	"serviceApi/proto/UserSrv"
)

func UserRegister(user userApi.UserRegister) (*UserSrv.UserRegisterRes, error) {
	register, err := global.UserClient.UserRegister(context.Background(), &UserSrv.UserRegisterReq{
		Mobile:   user.Mobile,
		Password: user.Password,
		NickName: user.Password,
		Email:    user.Email,
	})
	return register, err
}
func UserLogin(user userApi.UserLogin) (*UserSrv.UserLoginRes, error) {
	login, err := global.UserClient.UserLogin(context.Background(), &UserSrv.UserLoginReq{
		Mobile:   user.Mobile,
		Password: user.Password,
	})
	return login, err
}
